Telegram Group & Telegram Channel
132. Pattern


@ @
@ @ @ @
@ @ @
@ @ @
@ @ @ @
@ @ @ @ @
@ @ @
@ @ @ @ @
@ @ @ @
@ @ @
@ @ @
@ @ @ @
@ @



#include<stdio.h>
int main()
{
int n,x,y;
scanf("%d",&n);

if(n%2==0)
n=n+1;

for(y=3*n/2; y>=-3*(n/2); y--)
{
for(x=-3*(n/2); x<=3*(n/2); x++)
{
if((x>=-1*n/2 && x<=n/2) || (y>=-1*n/2 && y<=n/2))
{
if(x==y || x==-y)
printf("@ ");
else if((y<=0 || y>=n/2) && (x+y==n-1))
printf("@ ");
else if((y>=0 || y<=-n/2) && (x+y==1-n))
printf("@ ");
else if((x<=0 || x>=n/2) && (x-y==n-1))
printf("@ ");
else if((x>=0 || x<=-n/2) && (x-y==1-n))
printf("@ ");
else
printf(" ");
}
else
{
if(x+y==(n-1)*2)
printf("@ ");
else if(x+y==(1-n)*2)
printf("@ ");
else if(x-y==(n-1)*2)
printf("@ ");
else if(x-y==(1-n)*2)
printf("@ ");
else
printf(" ");
}
}
printf("\n");
}
}
#program_by : @I_am_liberal



tg-me.com/C_Codings/192
Create:
Last Update:

132. Pattern


@ @
@ @ @ @
@ @ @
@ @ @
@ @ @ @
@ @ @ @ @
@ @ @
@ @ @ @ @
@ @ @ @
@ @ @
@ @ @
@ @ @ @
@ @



#include<stdio.h>
int main()
{
int n,x,y;
scanf("%d",&n);

if(n%2==0)
n=n+1;

for(y=3*n/2; y>=-3*(n/2); y--)
{
for(x=-3*(n/2); x<=3*(n/2); x++)
{
if((x>=-1*n/2 && x<=n/2) || (y>=-1*n/2 && y<=n/2))
{
if(x==y || x==-y)
printf("@ ");
else if((y<=0 || y>=n/2) && (x+y==n-1))
printf("@ ");
else if((y>=0 || y<=-n/2) && (x+y==1-n))
printf("@ ");
else if((x<=0 || x>=n/2) && (x-y==n-1))
printf("@ ");
else if((x>=0 || x<=-n/2) && (x-y==1-n))
printf("@ ");
else
printf(" ");
}
else
{
if(x+y==(n-1)*2)
printf("@ ");
else if(x+y==(1-n)*2)
printf("@ ");
else if(x-y==(n-1)*2)
printf("@ ");
else if(x-y==(1-n)*2)
printf("@ ");
else
printf(" ");
}
}
printf("\n");
}
}
#program_by : @I_am_liberal

BY C Language πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/C_Codings/192

View MORE
Open in Telegram


C Language ‍ Telegram | DID YOU KNOW?

Date: |

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. β€œThe technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. β€œUnfortunately, a U.S. court stopped TON from happening.”

C Language ‍ from it


Telegram C Language πŸ‘¨β€πŸ’»
FROM USA